#include <stdio.h>

void grade ( int num )
{
        if      ( 90 <= num && num <=100)   printf("该同学成绩等级为A\n");
        else if ( 80 <= num  && num <90)    printf("该同学成绩等级为B\n");
        else if ( 70 <= num  && num <80)    printf("该同学成绩等级为C\n");
        else if ( 60 <= num  && num <70)    printf("该同学成绩等级为D\n");
        else                                printf("该同学成绩等级为不及格\n");
}
int main(int argc, char const* argv[])
{
    int i;
    printf ("请输入学生成绩:");
    scanf("%d", &i);
    while ( i != -1 )
    {
        grade(i);
        printf ("请输入学生成绩:");
        scanf("%d", &i);
    }
    printf("退出系统成功\n");
    return 0;
}